<?php
class CenterHeadWidget extends CWidget
{
    public function init()
    {
        parent::init();
    }
    public function run()
    {
        $message_count = 0;
        $is_shop_user = 0;
        if (!Yii::app()->user->isGuest) {
            $id= Yii::app()->user->getId();
            $message_count = Message::model()->getCount(array('user_id'=>$id,'is_read'=>Message::UN_READ));
            $user_info = User::model()->getDetail(Yii::app()->user->getId());
            if (!empty($user_info) && !empty($user_info['bind_self_shop'])) {
               
                    $is_shop_user =1;
                
            }
        }
        $this->render('center_head',compact('message_count','is_shop_user'));
    }
}
?>
